home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 542 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.9 KB

  1. Path: engnews1.Eng.Sun.COM!taumet!clamage
  2. From: "brian (b.c.) white" <bcwhite@bnr.ca>
  3. Newsgroups: comp.std.c++
  4. Subject: Re: Generic Object Callbacks
  5. Date: 26 Feb 1996 16:07:58 GMT
  6. Organization: Bell-Northern Research Ltd.
  7. Approved: clamage@eng.sun.com (comp.std.c++)
  8. Message-ID: <4gsi2p$905@bcarh8ab.bnr.ca>
  9. References: <pgpmoose.199602221531.14635@isolde.mti.sgi.com>
  10. NNTP-Posting-Host: taumet.eng.sun.com
  11. Content-Identifier:  Re: Generic O... 
  12. X-Nntp-Posting-Host: bcarsd26.bnr.ca 
  13. Originator: clamage@taumet
  14.  
  15. In article <pgpmoose.199602221531.14635@isolde.mti.sgi.com>,
  16. ian (i.) willmott <willmott@bnr.ca> wrote:
  17.  
  18. >In an article entitled "Q: Generic Callbacks -- Object->*func(...)"
  19. >(reference <4fti32$p3p@bcarh8ab.bnr.ca>), bcwhite@bnr.ca asks
  20.  
  21. >"Does the C++ standard allow for a generic callback to be specified?
  22. >Basically, I'd like to be able to pass an arbitrary object and
  23. >function of that object to be called at some later time."
  24.  
  25. >What is needed is the ability to use member functions as callbacks
  26. >without any constraint on the type of the object they are invoked on.
  27. >This is possible in C++ only by using various implementation-dependent
  28. >hacks to escape the type system, because the language does not provide
  29. >any way to express such a construct.
  30.  
  31. Of course, what we're really trying to with all this is to pass _code_
  32. (along with its context) as an object.
  33.  
  34.                                         Brian
  35.                                  ( bcwhite@bnr.ca )
  36.  
  37. -------------------------------------------------------------------------------
  38.     In theory, theory and practice are the same.  In practice, they're not.
  39. [ To submit articles: Try just posting with your newsreader.
  40.               If that fails, use mailto:std-c++@ncar.ucar.edu
  41.   FAQ:    http://reality.sgi.com/employees/austern_mti/std-c++/faq.html
  42.   Policy: http://reality.sgi.com/employees/austern_mti/std-c++/policy.html
  43.   Comments? mailto:std-c++-request@ncar.ucar.edu
  44. ]
  45.